﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Santa_sAdventure.View
{
    class BulletExplosionView
    {
        // Variables
        private Camera m_camera;
        private SplitterSystem m_splitterSystem;
        private SpriteBatch m_spriteBatch;
        private Texture2D m_sparkTexture;

        // Constructor
        public BulletExplosionView(SpriteBatch a_spriteBatch,Texture2D a_sparkTexture, Camera a_camera)
        {
            this.m_spriteBatch = a_spriteBatch;
            this.m_sparkTexture = a_sparkTexture;
            this.m_camera = a_camera;
        }

        // The startposition for the particles
        public void SetSystemStartPositions(float a_x, float a_y, int a_direction)
        {
            // The startposition for the particles
            m_splitterSystem = new SplitterSystem(new Vector2(a_x, a_y), a_direction); 
        }

        // Draw
        public void Draw(float a_elapsedTimeSeconds)
        {

            // If there is anything to draw
            if ( m_splitterSystem != null)
            {                
                m_splitterSystem.Draw(m_spriteBatch, m_camera, m_sparkTexture);
            }

        }

        // Update
        public void Update(float a_elapsedTimeSeconds)
        {
            // If there is anything to update
            if (m_splitterSystem != null)
            {
                m_splitterSystem.Update(a_elapsedTimeSeconds);                
            }
        }
    }
}
